// 大于255是中文字符算两个字节
function getBytesLens(target) {
  let count, len
  count = len = target.length
  for (let i = 0; i < len; i++) {
    if (target.charCodeAt(i) > 255) {
      count++
    }
  }
  console.log(count)
}
getBytesLens('人生如逆旅我亦是行人') //20
